<?php
function url_dirname($path, $level=1)
{
	//$path = preg_replace('#\\\\+|/+#', '/', $path);
	while ($level-- > 0) $path = dirname($path);
	if (strpos($path, '\\') !== false) $path = str_replace('\\', '/', $path);
	return $path === '/' ? $path : $path . '/';
}
$_base_dir = url_dirname(__FILE__);

$site_config = $_base_dir.'etc/config.php';

require_once $_base_dir.'lib/kernel.php';

class object {}

global $FU;

$FU      = new object ();
$FU->dir = new object ();
$FU->env = new object ();

$FU->dir->install  = $_install_dir;
$FU->dir->config   = $_config_dir;
$FU->dir->lib      = $_lib_dir;
$FU->dir->cache    = $_cache_dir;
$FU->dir->state    = $_state_dir;

$FU->env->name     = $_environment;
$FU->charset       = 'utf-8';
$FU->debug         = FALSE;
$FU->timezone      = 0;       // GMT+5

$FU->name          = 'funca';
$FU->admin_email   = 'nop@jetstyle.ru';
$FU->cookie_prefix = $FU->name.'_';

$FU->widgets->dir  = $FU->dir->lib.'Action/Community/widgets';

